package com.sn.springboot_netty.controller;

import com.sn.springboot_netty.common.result.ResultUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author fyy
 * @Description
 * @Date 2020/6/16 11:26
 */
@RestController
public class ExController {


    /**
     * 异常测试
     * @param username
     * @return
     */
    @GetMapping(value = "/exception")
    public Object exception2(String username){

        String realName = "123";

        if(null == username || StringUtils.isEmpty(username)){
            return ResultUtil.error("用户名为空！");
        }

        return ResultUtil.success("登录成功！");

    }


}
